var myVue = new Vue({
		el: "body",
		data: {
			myid: "",
			infoa: [],
			infob: [],
			infoc: [],
			showname: "",
			showtime: "",
			showstate: "",
			load:true
		},
		methods: {
			showdiv: function(e) {
				this.showname = e.attributes.othername;
				this.showtime = e.attributes.time;
				this.showstate = e.attributes.state;
				console.log(this.showstate);
				$("#my-alert").modal('open');
			},
			okdiv:function(){
				console.log("ok");
				$("#my-alert").modal('close');
			},
			backdiv:function(){
				$("#my-alert").modal('close');
			},
			back:function(){
					location.href = "../page4/page4.html";
			},
			adddiv:function(){
				$("#my-alert").modal('close');
			}
		},
		created: function() {
			init();
		}
	})
	//初始化
function init() {
	var APP_ID = 'Wx3JTgmqBaARoWCaGI96AM9h-gzGzoHsz';
	var APP_KEY = 'TrVpB16Og6Yac9u3BoiUy4hT';
	AV.init({
		appId: APP_ID,
		appKey: APP_KEY
	});
	//判断是否登录
	var curr = AV.User.current();
	if(curr) {
		console.log("欢迎" + curr.attributes.name + "的光临");
		//		myVue.myid = curr.id;
		//查询
		console.log(curr.id);
		var query = new AV.Query('order');
		query.contains('userid', curr.id);
		query.find().then(function(data) {
			console.log("进入");
			console.log(curr.id);
			console.log(data);
			funa(data);
			myVue.load=false;
		}, function(error) {
			console.log("失败");
		});
	} else {
		console.log("未登录");
	}
}
//分出摄影司仪酒店
function funa(e) {
	for(var i = 0; i < e.length; i++) {
		console.log(e[i].attributes.other);
		if(e[i].attributes.other == 1) {
			myVue.infoa.push(e[i]);
			console.log(myVue.infoa);
		} else if(e[i].attributes.other == 2) {
			myVue.infob.push(e[i]);
		} else if(e[i].attributes.other == 3) {
			myVue.infoc.push(e[i]);
		}
	}
}